<template>
	<view class="all">
		<view class="list" v-for="(item, index) in lists" :key="index">
			<view class="num" style="font-size: 35rpx;color: #CCCCCC;font-weight: bold;">
				{{index}}
			</view>
			<image src="../../static/images/my_portrait_empty.png" mode=""></image>
			<view class="user">
				<view class="name" style="color: #000000;font-weight: bold;font-size: 35rpx;">
					{{item.nickname}}
				</view>
				<view class="label" style="margin-top: 10rpx;">
					大富豪
				</view>
			</view>
			<view class="jsa" style="color:#ff2c2c;font-size: 40rpx;font-weight: bold; margin-left: 60rpx;">
				{{item.user_money}}
			</view>
		</view>
	</view>
</template>

<script>
	import  {rank}  from '@/api/user';
	export default {
		data() {
			return {
				type:""
			}
		},
		props: {
			types: {
				type: String,
				default: "sub"
			},
			typer:"1",
			lists:[]
		},
		created() {
			this.getast()
		},
		methods:{
			getast(){
				console.log(this.types)
				if(this.types=='profit'){
					this.typer="1"
				}else{
					this.typer="2"
				}
				let data={
					type:this.typer
				}
				rank(data).then(res=>{
					console.log(res)
					this.lists=res.data
				})
			}
		}
	}
</script>

<style lang="less">
	.all{
		padding: 0 30rpx;
		.list{
			margin-top: 20rpx;
			display: flex;
			align-items: center;
			image{
				margin-left: 30rpx;
				width: 150rpx;
				height: 150rpx;
			}
			.user{
				margin-left: 30rpx;
				text-align: center;
				.label{
					text-align: center;
					width: 140rpx;
					height: 55rpx;
					border-radius: 30rpx;
					background: linear-gradient(#f75303, #ffda52);
					color: #FFFFFF;
					line-height: 55rpx;
				}
			}
		}
	}
</style>
